package cn.iocoder.yudao.module.ai.dal.mysql.datasetversion;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.datasetversion.DatasetVersionDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.datasetversion.vo.*;

/**
 * 数据集发版列 Mapper
 *
 * @author 侯俊青
 */
@Mapper
public interface DatasetVersionMapper extends BaseMapperX<DatasetVersionDO> {

    default PageResult<DatasetVersionDO> selectPage(DatasetVersionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DatasetVersionDO>()
                .eqIfPresent(DatasetVersionDO::getDatasetId, reqVO.getDatasetId())
                .likeIfPresent(DatasetVersionDO::getName, reqVO.getName())
                .eqIfPresent(DatasetVersionDO::getDescription, reqVO.getDescription())
                .eqIfPresent(DatasetVersionDO::getSortNum, reqVO.getSortNum())
                .betweenIfPresent(DatasetVersionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DatasetVersionDO::getId));
    }

}